/**
 * @author YangTao
 * @date 2025/4/18
 */
package com.tian.core.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Component;

@Component
public class MailUtil {

    @Autowired
    private JavaMailSender mailSender;

    public void sendSimpleEmail(String deliver, String receiver, String subject, String content ){

        SimpleMailMessage message = new SimpleMailMessage();
        //发送者
        message.setFrom(deliver);
        //接收者
        message.setTo(receiver);
        //主题
        message.setSubject(subject);
        //内容
        message.setText(content);
        mailSender.send(message);

    }
}
